<style>
  .title {
    font-weight: bolder;
    margin-bottom: 20px;
    border-left: 4px solid #4fb1ec;
    background: #f4f5f6;
  }
</style>
<template>
  <div class="wrapper wrapper-content animated fadeInRight v-cloak" id="app" v-cloak>
    <div class="row">
      <div class="col-md-12">
        <form @submit.prevent="save()" accept-charset="UTF-8" class="form" id="reportBimonthlyForm" method="post">
          <input name="id" type="hidden" v-model="item.id"/>
          <input name="token" type="hidden" v-model="item.token"/>
          <input name="newFlag" type="hidden" v-model="newFlag"/>
          <div class="clearfix col-md-12 title">专项行动</div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">月报月份：</label>
              <div class="col-md-12">
                <div class="input-group">
                  <input autocomplete="off" id="bean-dateReportBegin" name="dateReportBegin" v-model="item.dateReportBegin" class="laydate-icon form-control layer-date" type="text" placeholder="月报月份(起)" required="" aria-required="true" aria-describedby="bean-dateReportBegin-error" aria-invalid="true">
                  <span class="input-group-addon"> - </span>
                  <input autocomplete="off" id="bean-dateReportEnd" name="dateReportEnd" v-model="item.dateReportEnd" class="laydate-icon form-control layer-date" type="text" placeholder="月报月份(止)" required="" aria-required="true" aria-describedby="bean-dateReportEnd-error" aria-invalid="true">
                </div>
              </div>
            </div>
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">县级开展专项行动次数：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-specialCountyNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-specialCountyNum" name="specialCountyNum" placeholder="请输入县级开展专项行动次数" required="" type="text" v-model="item.specialCountyNum">
                <span class="help-block m-b-none" for="bean-specialCountyNum" id="bean-specialCountyNum-error"></span>
              </div>
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">乡级开展专项行动次数：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-specialTownNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-specialTownNum" name="specialTownNum" placeholder="请输入乡级开展专项行动次数" required="" type="text" v-model="item.specialTownNum">
                <span class="help-block m-b-none" for="bean-specialTownNum" id="bean-specialTownNum-error"></span>
              </div>
            </div>
          </div>
          <div class="clearfix col-md-12 title">问责</div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">问责-通报（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-accountabilityBulletinNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-accountabilityBulletinNum" name="accountabilityBulletinNum" placeholder="请输入问责-通报（人次）" required="" type="text" v-model="item.accountabilityBulletinNum">
                <span class="help-block m-b-none" for="bean-accountabilityBulletinNum" id="bean-accountabilityBulletinNum-error"></span>
              </div>
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">问责-诫勉谈话（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-accountabilityTalkNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-accountabilityTalkNum" name="accountabilityTalkNum" placeholder="请输入问责-诫勉谈话（人次）" required="" type="text" v-model="item.accountabilityTalkNum">
                <span class="help-block m-b-none" for="bean-accountabilityTalkNum" id="bean-accountabilityTalkNum-error"></span>
              </div>
            </div>
          </div>
          <div class="clearfix col-md-12 title">行政处分</div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">行政处分-警告（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-executiveWarningNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-executiveWarningNum" name="executiveWarningNum" placeholder="请输入行政处分-警告（人次）" required="" type="text" v-model="item.executiveWarningNum">
                <span class="help-block m-b-none" for="bean-executiveWarningNum" id="bean-executiveWarningNum-error"></span>
              </div>
            </div>

            <div class="form-group clearfix">
              <label class="col-md-8 control-label">行政处分-降级（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-executiveDemoteNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-executiveDemoteNum" name="executiveDemoteNum" placeholder="请输入行政处分-降级（人次）" required="" type="text" v-model="item.executiveDemoteNum">
                <span class="help-block m-b-none" for="bean-executiveDemoteNum" id="bean-executiveDemoteNum-error"></span>
              </div>
            </div>

            <div class="form-group clearfix">
              <label class="col-md-8 control-label">行政处分-开除（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-executiveExpelNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-executiveExpelNum" name="executiveExpelNum" placeholder="请输入行政处分-开除（人次）" required="" type="text" v-model="item.executiveExpelNum">
                <span class="help-block m-b-none" for="bean-executiveExpelNum" id="bean-executiveExpelNum-error"></span>
              </div>
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">行政处分-记过（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-executiveDemeritNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-executiveDemeritNum" name="executiveDemeritNum" placeholder="请输入行政处分-记过（人次）" required="" type="text" v-model="item.executiveDemeritNum">
                <span class="help-block m-b-none" for="bean-executiveDemeritNum" id="bean-executiveDemeritNum-error"></span>
              </div>
            </div>

            <div class="form-group clearfix">
              <label class="col-md-8 control-label">行政处分-撤职（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-executiveDismissedNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-executiveDismissedNum" name="executiveDismissedNum" placeholder="请输入行政处分-撤职（人次）" required="" type="text" v-model="item.executiveDismissedNum">
                <span class="help-block m-b-none" for="bean-executiveDismissedNum" id="bean-executiveDismissedNum-error"></span>
              </div>
            </div>
          </div>
          <div class="clearfix col-md-12 title">党纪处分</div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">党纪处分-警告（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-partyWarningNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-partyWarningNum" name="partyWarningNum" placeholder="请输入党纪处分-警告（人次）" required="" type="text" v-model="item.partyWarningNum">
                <span class="help-block m-b-none" for="bean-partyWarningNum" id="bean-partyWarningNum-error"></span>
              </div>
            </div>

            <div class="form-group clearfix">
              <label class="col-md-8 control-label">党纪处分-撤除党内职务（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-partyDismantleInnerjobNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-partyDismantleInnerjobNum" name="partyDismantleInnerjobNum" placeholder="请输入党纪处分-撤除党内职务（人次）" required="" type="text" v-model="item.partyDismantleInnerjobNum">
                <span class="help-block m-b-none" for="bean-partyDismantleInnerjobNum" id="bean-partyDismantleInnerjobNum-error"></span>
              </div>
            </div>


            <div class="form-group clearfix">
              <label class="col-md-8 control-label">党纪处分-开除党籍（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-partyExpelledMembershipNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-partyExpelledMembershipNum" name="partyExpelledMembershipNum" placeholder="请输入党纪处分-开除党籍（人次）" required="" type="text" v-model="item.partyExpelledMembershipNum">
                <span class="help-block m-b-none" for="bean-partyExpelledMembershipNum" id="bean-partyExpelledMembershipNum-error"></span>
              </div>
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">党纪处分-其他形式（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-partyOtherNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-partyOtherNum" name="partyOtherNum" placeholder="请输入党纪处分-其他形式（人次）" required="" type="text" v-model="item.partyOtherNum">
                <span class="help-block m-b-none" for="bean-partyOtherNum" id="bean-partyOtherNum-error"></span>
              </div>
            </div>

            <div class="form-group clearfix">
              <label class="col-md-8 control-label">党纪处分-严重警告（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-partySeriousWarningNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-partySeriousWarningNum" name="partySeriousWarningNum" placeholder="请输入党纪处分-严重警告（人次）" required="" type="text" v-model="item.partySeriousWarningNum">
                <span class="help-block m-b-none" for="bean-partySeriousWarningNum" id="bean-partySeriousWarningNum-error"></span>
              </div>
            </div>

            <div class="form-group clearfix">
              <label class="col-md-8 control-label">党纪处分-留党察看（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-partyCheckNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-partyCheckNum" name="partyCheckNum" placeholder="请输入党纪处分-留党察看（人次）" required="" type="text" v-model="item.partyCheckNum">
                <span class="help-block m-b-none" for="bean-partyCheckNum" id="bean-partyCheckNum-error"></span>
              </div>
            </div>
          </div>
          <div class="clearfix col-md-12 title">巡河情况</div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">巡河情况-巡河（湖）人次：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-patrolRiverNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-patrolRiverNum" name="patrolRiverNum" placeholder="请输入巡河情况-巡河（湖）人次" required="" type="text" v-model="item.patrolRiverNum">
                <span class="help-block m-b-none" for="bean-patrolRiverNum" id="bean-patrolRiverNum-error"></span>
              </div>
            </div>

            <div class="form-group clearfix">
              <label class="col-md-8 control-label">巡河情况-发现问题：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-patrolDiscoverProblemsNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-patrolDiscoverProblemsNum" name="patrolDiscoverProblemsNum" placeholder="请输入巡河情况-发现问题" required="" type="text" v-model="item.patrolDiscoverProblemsNum">
                <span class="help-block m-b-none" for="bean-patrolDiscoverProblemsNum" id="bean-patrolDiscoverProblemsNum-error"></span>
              </div>
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">巡河情况-解决问题：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-patrolSolveProblemsNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-patrolSolveProblemsNum" name="patrolSolveProblemsNum" placeholder="请输入巡河情况-解决问题" required="" type="text" v-model="item.patrolSolveProblemsNum">
                <span class="help-block m-b-none" for="bean-patrolSolveProblemsNum" id="bean-patrolSolveProblemsNum-error"></span>
              </div>
            </div>
          </div>
          <div class="clearfix col-md-12 title">培训情况</div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">培训情况-培训人次：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-patrolTraineesNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-patrolTraineesNum" name="patrolTraineesNum" placeholder="请输入培训情况-培训人次" required="" type="text" v-model="item.patrolTraineesNum">
                <span class="help-block m-b-none" for="bean-patrolTraineesNum" id="bean-patrolTraineesNum-error"></span>
              </div>
            </div>

            <div class="form-group clearfix">
              <label class="col-md-8 control-label">培训情况-培训班次：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-patrolTrainingshiftNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-patrolTrainingshiftNum" name="patrolTrainingshiftNum" placeholder="请输入培训情况-培训班次" required="" type="text" v-model="item.patrolTrainingshiftNum">
                <span class="help-block m-b-none" for="bean-patrolTrainingshiftNum" id="bean-patrolTrainingshiftNum-error"></span>
              </div>
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">培训情况-河长（湖长）培训（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-patrolRiverSupervisorNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-patrolRiverSupervisorNum" name="patrolRiverSupervisorNum" placeholder="请输入培训情况-河长（湖长）培训（人次）" required="" type="text" v-model="item.patrolRiverSupervisorNum">
                <span class="help-block m-b-none" for="bean-patrolRiverSupervisorNum" id="bean-patrolRiverSupervisorNum-error"></span>
              </div>
            </div>

            <div class="form-group clearfix">
              <label class="col-md-8 control-label">培训情况-河长办工作人员培训（人次）：</label>
              <div class="col-md-12">
                <input aria-describedby="bean-patrolRiverStaffNum-error" aria-invalid="true" aria-required="true" class="form-control" id="bean-patrolRiverStaffNum" name="patrolRiverStaffNum" placeholder="请输入培训情况-河长办工作人员培训（人次）" required="" type="text" v-model="item.patrolRiverStaffNum">
                <span class="help-block m-b-none" for="bean-patrolRiverStaffNum" id="bean-patrolRiverStaffNum-error"></span>
              </div>
            </div>

          </div>
          <div class="col-md-12">
            <div class="form-group clearfix">
              <label class="col-md-8 control-label">备注：</label>
              <div class="col-md-12">
                <textarea aria-describedby="bean-memo-error" aria-invalid="true" class="form-control" id="bean-memo" maxlength="255" name="memo" placeholder="请输入备注" v-model="item.memo"></textarea>
                <span class="help-block m-b-none" for="bean-memo" id="bean-memo-error"></span>
              </div>
            </div>

          </div>

          <div class="clearfix "></div>
          <div class="col-12 text-center" style="height: 50px;">
            <div>
              <input class="btn btn-primary" type="submit" value="保存"/> | <a @click="lbox.closeMyBoxLayer()" class="btn btn-danger" href="javascript:">返回</a>
            </div>
          </div>
        </form>
        </div>
    </div>
  </div>
</template>
<script type="text/javascript">
  import '@/assets/css/style.css'

  import $ from '@/assets/js/jquery-vendor.js'
  import 'jquery.cookie'
  import axios from 'axios'
  import '@/assets/js/validate/validation-vendor.js'

  import 'layui-laydate/dist/theme/default/laydate.css'
  import laydate from 'layui-laydate'
  import {apiUtil, axiosContentType, site} from '@/assets/js/boss'

  export default {
    data() {
      return {
        item: {},
        newFlag: 0,
        uuidToken: ''
      }
    },
    mounted() {
      let that = window.$vueApp = this;
      document.getElementsByTagName('body')[0].className = 'fixed-sidebar full-height-layout';
      $('#reportBimonthlyForm').validate();
      that.staff.init(function () {
        that.newFlag = sessionStorage.getItem(site.reportBimonthly.info);
        if (that.newFlag) that.uuidToken = apiUtil.guid();
        if (apiUtil.existSessionKey(site.reportBimonthly.info)) {
          that.info();
        }
      });

      laydate.render({
        elem: '#bean-dateReportBegin',
        event: 'click',
        type: 'month',
        done: function (val) {
          that.item.dateReportBegin = val;
        }
      });

      laydate.render({
        elem: '#bean-dateReportEnd',
        event: 'click',
        type: 'month',
        done: function (val) {
          that.item.dateReportEnd = val;
        }
      });
    },
    methods: {
      info() {
        let that = this;
        axios.get(site.reportBimonthly.info + sessionStorage.getItem(site.reportBimonthly.info), {}).then(function (response) {
          const result = response.data;
          if (result.code === 0) {
            that.item = result.data;
          } else {
            alert(result.message);
          }
        });
      },
      save() {
        let that = this;
        if ($('#reportBimonthlyForm').valid()) {
          axios.post(site.reportBimonthly.save, $('#reportBimonthlyForm').serialize(),
            axiosContentType.xWwwFormUrlencoded).then(function (response) {
            const result = response.data;
            // console.info("获取数据.." + JSON.stringify(result));
            if (result.code === 0) {
              parent.$vueApp.page();
              alert('保存成功!');
              that.lbox.closeMyBoxLayer()
            } else {
              alert(result.message);
            }
          });
        }
      }
    }
  }
</script>

